<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('categories', function (Blueprint $table) {
            $table->increments('category_id')->comment('主键');
            $table->string('name', 20)->comment('栏目名称');
            $table->string('allow_levels', 100)->comment('允许查看的用户等级json, 为空则无限制')->nullable();
            $table->boolean('in_nav')->comment('是否在导航展示')->default(1);
            $table->integer('order')->comment('排序')->default(0);
            $table->boolean('in_use')->comment('是否可用0->不可用 1->可用')->default(1);
            $table->string('jump_url', 50)->comment('跳转链接, 有的话就直接跳转')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('categories');
    }
}
